package com.ims.service.impl;

import com.b2c.common.third.thymeleaf.PagingResponse;
import com.ims.entity.MediaDataReportEntity;
import com.ims.entity.MediaDataReportItemEntity;
import com.ims.repository.MediaDataReportRepository;
import com.ims.service.MediaDataReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MediaDataReportServiceImpl implements MediaDataReportService {
    @Autowired
    private MediaDataReportRepository repository;
    @Override
    public void addData(Integer mediaAccountId, Integer userCount, String summary, String improvement,String reportPeriod, List<MediaDataReportItemEntity> dataItems) {
        repository.addData(mediaAccountId,userCount,summary,improvement,reportPeriod,dataItems);
    }

    @Override
    public Integer addData(MediaDataReportEntity reportEntity) {
      return repository.addData(reportEntity);
    }

    @Override
    public void editData(Integer id, Integer userCount, String summary, String improvement, String reportPeriod, List<MediaDataReportItemEntity> dataItems) {
        repository.editData(id,userCount,summary,improvement,reportPeriod,dataItems);
    }

    @Override
    public PagingResponse<MediaDataReportEntity> getList(int pageIndex, int pageSize, Integer mediaAccountId) {
        return repository.getList(pageIndex,pageSize,mediaAccountId);
    }

    @Override
    public MediaDataReportEntity getById(Integer id) {
        return repository.getById(id);
    }
}
